<fieldset>
  <legend>搜索用户</legend>
    <form method="post">
    	<div>
    		<label>用户名</label>
    		<input name="username" type="text" value="<?php echo $this->context->request("username") ?>" />
    	</div>
    	<div>
    		<label>注册IP</label>
    		<input name="signup_ip" type="text" value="<?php echo $this->context->request("signup_ip") ?>" />
    	</div>
    	<div>
    		<label></label>
    		<input type="submit" class="submit" value="搜索" />
    	</div>
    </form>
</fieldset>
<fieldset>
	<legend>搜索结果</legend>
	<form method="post" action="<?php echo Url::generate($this->context->uri['module'], 'DoBatchEdit') ?>">
		<table>
		  <tr>
		    <th>用户名</th>
		    <th>密码（不改请留空）</th>
		    <th>禁用</th>
		    <th>注册IP</th>
		    <th>注册时间</th>
		    <th>最后修改</th>
		    <th>操作</th>
		 <tr>
		<?php
		if (isset($this->users) && is_array($this->users))
		{
			foreach ($this->users as $user)
			{
		?>
		  <tr>
		    <td><?php echo $user['username'] ?></td>
		    <td><input name="user[<?php echo $user['id'] ?>][password]" type="text" /></td>
		    <td><input name="user[<?php echo $user['id'] ?>][disabled]" type="checkbox" value="1" <?php echo 1 == $user['disabled'] ? 'checked="checked"' : '' ?> /></td>
		    <td><?php echo long2ip($user['signup_ip']) ?></td>
		    <td><?php echo date('y-m-d H:i', $user['created']) ?></td>
		    <td><?php echo date('y-m-d H:i', $user['modified']) ?></td>
		    <td>
		    	<a href="<?php echo Url::generate('User', 'Edit', array('id' => $user['id'])) ?>">修改</a>
		    	<a href="<?php echo Url::generate('IpBlacklist', 'Search', array('ip' => long2ip($user['signup_ip']))) ?>">查询此IP是否在黑名单</a>
		    </td>
		  </tr>
		<?php
			}
		}
		?>
		</table>
		<input type="submit" class="submit" value="批量更新" />
	</form>
</fieldset>
